<template>
  <div class="app-container">
  <el-form ref="form" :model="form" label-width="80px">
  <el-form-item label="appid">
    <el-input v-model="form.appid" style="width:300px"></el-input>
  </el-form-item>

 <el-form-item label="appsecret" >
    <el-input v-model="form.appsecret"  style="width:300px"></el-input>
  </el-form-item>
 
 
  <el-form-item>
    <el-button type="primary" @click="onSubmit">立即创建</el-button>
  </el-form-item>
</el-form>
  </div>
</template>

<script>
import {seting} from '@/api/appid'
import {getInfo} from '@/api/user'
export default {
 data() {
      return {
        form: {
        appid: '',
        appsecret:''
        }
      }
    },
    mounted(){
     getInfo().then(res=>{
                // console.log(res);
            this.form =res.data
                            })
    },
    methods: {
      onSubmit() {
        seting({appid:this.form.appid,appsecret:this.form.appsecret}).then(res=>{
            this.$message({ type: 'success',message: '设置成功!'  });
               getInfo().then(res=>{
                        // console.log(res);
                    this.form =res.data
                                })
        })
      }
    }
}
</script>

<style>

</style>